import {request} from '@umijs/max';
import * as API from "@/services";


/** 支付订单 分页检索请求 */
export async function queryPayOrders(params: API.PayOrderPageQueryParams): Promise<API.RespPageResult<API.PayOrder>> {
  return request('/api/v1/pay-order', {
    params,
  });
}

/** 支付订单 详情请求 */
export async function queryPayOrder(bizId: API.EntityId): Promise<API.RespResult<API.PayOrder>> {
  return request(`/api/v1/pay-order/${bizId}`);
}

/** 支付订单 创建请求 */
export async function createPayOrder(entity: API.PayOrder_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-order`, {
    method: 'POST',
    data: entity,
  });
}

/** 支付订单 修改请求 */
export async function modifyPayOrder(entity: API.PayOrder_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-order/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 支付订单 修改(部分)请求 */
export async function patchPayOrder(entity: API.PayOrder_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-order/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 支付订单 删除请求 */
export async function deletePayOrder(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-order/${bizId}`, {
    method: 'DELETE',
  });
}

/** 支付订单 批量删除请求 */
export async function deletePayOrders(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-order`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
